import { SkillInfo } from "../../model/SkillInfo";
import { SkillListPanel } from "./SkillListPanel";
import { SkillInfoPanel } from "./SkillInfoPanel";
//class SkillMainPanel
    
    export  class SkillMainPanel /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.creatChirldren();
            this.updateSize();
            return;
        }

        public initSkill(arg1: Array<any>, arg2: Boolean=true): void
        {
            this._skillInfo.optAble = arg2;
            if (arg1.length > 0) 
            {
                this._skillList.initSkill(arg1);
                this.updateSkillInfo(arg1[0]);
                this._skillList.itemClick(arg1[0].position);
            }
            return;
        }

        protected updateSkillInfo(arg1: SkillInfo): void
        {
            this._skillInfo.updateInfo(arg1);
            return;
        }

        public updateSkill(arg1: SkillInfo): void
        {
            var loc1=this._skillList.updateSkill(arg1);
            if (loc1) 
            {
                this._skillInfo.updateInfo(loc1);
            }
            else if (arg1.position == this._skillInfo.skillPos) 
            {
                this._skillInfo.updateInfo(arg1);
            }
            return;
        }

        public startCoolDown(arg1: SkillInfo): void
        {
            this._skillList.startCoolDown(arg1);
            return;
        }

        public get skillListPanel(): SkillListPanel
        {
            return this._skillList;
        }

        public get skillInfoPanel(): SkillInfoPanel
        {
            return this._skillInfo;
        }

        protected creatChirldren(): void
        {
            return;
        }

        protected updateSize(): void
        {
            return;
        }

        public /* override */ get width(): number
        {
            return 474;
        }

        public /* override */ get height(): number
        {
            return 390;
        }

        protected /* var */_skillList: SkillListPanel;

        protected /* var */_skillInfo: SkillInfoPanel;
    }
